<?php
namespace Home\Controller;

use Think\Controller;

class IndexController extends BaseController
{
    public function index()
    {
        //新闻分栏显示
        $news_list = D("News")->table("dsk_news")->order(array('add_time' => "desc"))->limit(20)->select();
        //产品展示
        $books_list = D("Book")->table("dsk_books")->order(array('sort_order' => "desc", 'id' => "asc"))->limit(8)->select();
        $banner_list = D("Banner")->table("dsk_banner")->order(array('sort_order' => "desc", 'id' => "asc"))->select();
        $data = array(
            "news_list" => $news_list,
            "books_list" => $books_list,
            "banner_list" => $banner_list,
            "menu" => "home",
        );
        $this->assign($data);
        $this->display();
    }
}